<script setup>
import { onShow, onHide, onLaunch } from "@dcloudio/uni-app";
import { getCurrentInstance } from "vue";
import { useStore } from "vuex";

const store = useStore();
const setPageHide = (data = false) => store.commit("page/SET_PAGE_HIDE", data);

onShow(() => {
  setPageHide(false);
});
onHide(() => {
  setPageHide(true);
});
onLaunch(() => {
  const { appContext } = getCurrentInstance();
  console.log(appContext.config.globalProperties.env);

  store.dispatch("user/getUserInfo");

  uni.onKeyboardHeightChange((res) => {
    console.log("键盘变化：", res);
    store.commit("keyboard/SET_KEYBOARD_HEIGHT", res);
  });
});
</script>

<style lang="scss">
@import "@/uni_modules/uv-ui-tools/libs/css/variable.scss";
page {
  min-height: 100vh;
  box-sizing: border-box;
}

view,
text,
scroll-view {
  font-family: Source Han Sans CN;
  box-sizing: border-box;
}

input {
  font-size: 24rpx;
  color: #333;
  height: 40rpx;
  line-height: 40rpx;

  &::placeholder {
    font-size: 24rpx;
    color: #999;
  }
}

image {
  width: 100%;
  height: 100%;
  display: block;
}

.customInputPlaceholder {
  color: #666666 !important;
}

.uv-list {
  border-bottom: none !important;
}
</style>

<style lang="scss">
.flex {
  display: flex;
}
.inline-flex {
  display: inline-flex;
}

.flex-1 {
  flex: 1;
}

.f-ai-c {
  align-items: center;
}

.f-ai-fs {
  align-items: flex-start;
}

.f-ai-fe {
  align-items: flex-end;
}

.f-jc-c {
  justify-content: center;
}

.f-jc-sb {
  justify-content: space-between;
}

.f-jc-sa {
  justify-content: space-around;
}

.f-jc-fs {
  justify-content: flex-start;
}

.f-jc-fe {
  justify-content: flex-end;
}

.f-fw-w {
  flex-wrap: wrap;
}

.f-fd-c {
  flex-direction: column;
}

.ta-r {
  text-align: right;
}

.ta-l {
  text-align: left;
}

.ta-c {
  text-align: center;
}

.fw {
  font-weight: 600;
}
$max: 50;
$unit: 1rpx;
@for $i from 1 through $max {
  .fs#{$i * 2} {
    font-size: $unit * $i * 2;
  }

  .mt#{$i * 2} {
    margin-top: $unit * $i * 2;
  }

  .mb#{$i * 2} {
    margin-bottom: $unit * $i * 2;
  }

  .ml#{$i * 2} {
    margin-left: $unit * $i * 2;
  }

  .mr#{$i * 2} {
    margin-right: $unit * $i * 2;
  }

  .pt#{$i * 2} {
    padding-top: $unit * $i * 2;
  }

  .pb#{$i * 2} {
    padding-bottom: $unit * $i * 2;
  }

  .pl#{$i * 2} {
    padding-left: $unit * $i * 2;
  }

  .pr#{$i * 2} {
    padding-right: $unit * $i * 2;
  }

  .w#{$i * 2} {
    width: $unit * $i * 2;
  }

  .h#{$i * 2} {
    height: $unit * $i * 2;
  }
}
</style>
